// Package 2_linklist list_node
// @Title 2_linklist
// @Description
// @Author  == 琳琳也叫王木木 ==  2021/9/2 14:07
// @Create  2021/9/2 14:07
package __linklist

import "math"

type ListNode struct {
	Val  int
	Next *ListNode
}

// DisPlayListNode 打印ListNode的元素
func DisPlayListNode(root *ListNode) []int {
	ans := make([]int, 0)
	if root == nil {
		return []int{math.MaxInt32}
	}
	for root != nil {
		ans = append(ans, root.Val)
		root = root.Next
	}

	return ans
}
